/**
 * Created by wangshaohua on 2017/10/16.
 */
moduleStudyMap.controller("TaskContentListController", function ($scope, $log, UserTaskContentResource, $state, LoadingService, ConstantService, DialogService) {
    $scope.$on("$viewContentLoaded", function () {
        pageOnLoad();
        $scope.queryPara = {};
        //$scope.currentState = $state.current;
        //ConstantService.addState($state.current, true);
        $scope.pagination = new Pagination();
        $scope.pagination.setPageClickFn($scope.queryData);
        $scope.queryData($scope.pagination.currentPageNo);
    });

    $scope.queryData = function (pageNo) {
        //LoadingService.show();
        UserTaskContentResource.query({pageNo: pageNo - 1, pageSize: 10}, $scope.queryPara, function (queryResult) {
            $log.debug("查询结果: \n", queryResult);
            $scope.queryResult = queryResult;
            $scope.pagination.setPage(queryResult, pageNo);
            //LoadingService.hide();
        });
    };

});